package com.gopay.common.constants.bank;

/**
 * 订单状态码
 * 
 * @BankOrderConstants.java
 * @author yaobo
 * @2013-2-19 下午03:53:46 www.gopay.com.cn Inc.All rights reserved.
 */
public class BankOrderStatus {

    /**
     * 进行中
     */
    public static final String PROCESS = "00";

    /**
     * 失败
     */
    public static final String FAIL = "99";

    /**
     * 银行返回成功
     */
    public static final String BANK_CALL_SUCCESS = "02";

    /**
     * 接口对账成功
     */
    public static final String AUTO_CHECK_SUCCESS = "03";

    /**
     * 手工对账成功
     */
    public static final String CHECK_SUCCESS = "04";
    
    /**
     * BPS对账成功
     */
    public static final String BPS_CHECK_SUCCESS = "05";
    
    /**
     * BPS对账失败
     */
    public static final String BPS_CHECK_FAIL = "99";


    /**
     * 银行通知订单失败
     */
    public static final String ORDER_FAIL = "91";

    /**
     * 银行通知验签失败
     */
    public static final String VERIFY_FAIL = "92";

    /**
     * 金额比对异常
     */
    public static final String AMOUNT_ERROR = "93";

    /**
     * 作废
     */
    public static final String CANCEL = "94";

    /**
     * 超时
     */
    public static final String TIMEOUT = "95";

    /**
     * 入账失败
     */
    public static final String ENTER_ACCOUNT_FIAL = "96";
    
    /**
     * 已受理
     */
    public static final String  ACCEPTED = "11";

    public static String translate(String code){
        if(code == null){
            return "";
        } else if(code.equals(PROCESS)){
            return "进行中";
        } else  if(code.equals(FAIL)){
            return "失败";
        } else  if(code.equals(BANK_CALL_SUCCESS)){
            return "银行返回成功";
        } else  if(code.equals(AUTO_CHECK_SUCCESS)){
            return "接口对账成功";
        } else  if(code.equals(CHECK_SUCCESS)){
            return "手工对账成功";
        } else  if(code.equals(BPS_CHECK_SUCCESS)){
            return "BPS对账成功";
        } else  if(code.equals(BPS_CHECK_FAIL)){
            return "BPS对账失败";
        } else  if(code.equals(ORDER_FAIL)){
            return "银行通知订单失败";
        } else  if(code.equals(VERIFY_FAIL)){
            return "银行通知验签失败";
        } else  if(code.equals(AMOUNT_ERROR)){
            return "金额比对异常";
        } else  if(code.equals(CANCEL)){
            return "作废";
        } else  if(code.equals(TIMEOUT)){
            return "超时";
        } else  if(code.equals(ENTER_ACCOUNT_FIAL)){
            return "入账失败";
        } else  if(code.equals(ACCEPTED)){
            return "已受理";
        } else {
            return "";
        }
    }
}
